// import produce from 'immer';

export default {
    state: {
        // leftLayouts: ["style1", "style2", "style3", "style4", "style5"],
        // rightLayouts: ["style1", "style2"],
        // curLeftIndex: 0,
        // curRightIndex: 0,
        imglist: {
            cur: 1,
            arr: [
                { id: 1, value: "style1", text: "简约型" },
                { id: 2, value: "style2", text: "图文型" },
                { id: 3, value: "style3", text: "综合型" },
                { id: 4, value: "style4", text: "图形卡片" },
                { id: 5, value: "style5", text: "文字卡片" },
            ]
        },
        siderlist: {
            cur: 11,
            arr: [
                { id: 11, value: "style1", text: "时间轴" },
                { id: 12, value: "style2", text: "简约列表" },
            ]
        },
        IsListLeft: true,
    },
    subscriptions: {
        setup({ dispatch, history }) {
            // dispatch({ type: "fetch" })
        },
    },
    reducers: {
        setIsListLeft(state, { b }) {
            state.IsListLeft = b;
        },
        setImglistCur(state, { id }) {
            state.imglist.cur = id;
        },
        setSiderlistCur(state, { id }) {
            state.siderlist.cur = id;
        },
        // setCurLeftIndex(state, { index }) {
        //     state.curLeftIndex = index;
        // },
        // setCurRightIndex(state, { index }) {
        //     state.curRightIndex = index;
        // }
    },
    effects: {
        *fetch({ type, payload }, { put, call, select }) {
            // yield delay(3000);
            // yield call(delay, 3000);
            // yield put({ "type": "add" });

        },
    },
}